package com.wgworkshop.pems.model;

import com.wgworkshop.pems.checkgroup.CreateCheckGroup;
import com.wgworkshop.pems.checkgroup.PatchCheckGroup;
import com.wgworkshop.pems.checkgroup.UpdateCheckGroup;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 作品模型。
 * Created by wlc on 2017/8/31.
 */
public class WorkModel {
    @Null(message = "作品ID只能为null。",
            groups = {CreateCheckGroup.class, PatchCheckGroup.class})
    @NotNull(message = "作品ID不能为null。",
            groups = UpdateCheckGroup.class)
    @Min(value = 1,
            message = "不正确的作品ID[${validatedValue}]。",
            groups = UpdateCheckGroup.class)
    private Long id;
    @NotNull(message = "学生ID不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Min(value = 1,
            message = "不正确的学生ID[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Long studentId;
    @NotNull(message = "课程日期不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    private Date courseDate;
    @Size(max = 32,
            message = "作品名称长度应该不大于{max}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String name;
    @NotNull(message = "作品存储空间不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Size(min = 1,
            max = 64,
            message = "作品存储空间应该介于{min}到{max}之间。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String bucket;
    @NotNull(message = "作品对象名称不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Size(min = 1,
            max = 256,
            message = "作品对象名称应该介于{min}到{max}之间。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String object;
    @NotNull(message = "作品eTag不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Size(min = 1,
            max = 32,
            message = "作品eTag应该介于{min}到{max}之间。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String eTag;
    @NotNull(message = "作品尺寸不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Min(value = 0,
            message = "不正确的作品尺寸[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Integer size;
    @NotNull(message = "作品mimeType不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Size(min = 1,
            max = 64,
            message = "作品mimeType应该介于{min}到{max}之间。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String mimeType;
    @Min(value = 0,
            message = "不正确的作品宽度[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Integer width;
    @Min(value = 0,
            message = "不正确的作品高度[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Integer height;
    @Size(max = 16,
            message = "作品格式应该不大于{max}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String format;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public Date getCourseDate() {
        return courseDate;
    }

    public void setCourseDate(Date courseDate) {
        this.courseDate = courseDate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public String getObject() {
        return object;
    }

    public void setObject(String object) {
        this.object = object;
    }

    public String geteTag() {
        return eTag;
    }

    public void seteTag(String eTag) {
        this.eTag = eTag;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public String getMimeType() {
        return mimeType;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }
}
